import {
    NativeModules,
    Platform,
    DeviceEventEmitter
} from 'react-native';

import React, {
    Component,
} from 'react';


const _module = NativeModules.IbuildLocation;

export default{
    getCurrentPosition() {
        return new Promise((resolve, reject) => {
            try {
                _module.getCurrentPosition();
            }
            catch (e) {
                reject(e);
                return;
            }
            DeviceEventEmitter.once('onGetCurrentLocationPosition', resp => {
                resolve(resp);
            });
        });
    }
};